<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
		<style type="text/css">
			#box{
				width: 300px;
				height: 150px;
				border: 1px solid blue;
				margin: 100px auto;
				/*溢出隐藏,会出现滚动条*/
				overflow: auto;
			}
			#box-inner{
				width: 290px;
				height: 400px;
				background-color: orangered;
				margin: 100px auto;
			}
		</style>
	</head>
	<body>
		<div id="box">
			<div id="box-inner">
				
			</div>
		</div>
		<script type="text/javascript">
			var oBoxinner = document.getElementById("box-inner")
			var oBox = document.getElementById("box")
			document.onclick = function  () {
				//上，滚动出去的距离
				console.log(oBox.scrollTop)
				//内部实际占的宽度
				console.log(oBox.scrollWidth)
				console.log(oBox.scrollHeight)
			}
		</script>
	</body>
</html>
